This invention relates to a key switch system capable of scanning closed (or open) key switches very rapidly to produce corresponding key data, encoding the key data into corresponding key codes, and effectively registering the encoded key codes in time-shared channels of a key code memory.
In a case wherein ON (or OFF) information of key switches in an apparatus containing a large number of key switches such as a keyboard of an electronic musical instrument is to be transferred to a utilization circuit, complicated wiring is required. Therefore, it is uneconomical if these switches are connected to the circuit by individual connecting lines. Such method also is disadvantageous in that it cannot be used in a semiconductor integrated circuit in which the number of connecting pins is limited. As a result, an apparatus using such method tends to be bulky.
With a view to eliminating the above-described difficulties, the applicant has proposed in their U.S. Pat. No. 3,882,751 a system according to which all switches are sequentially scanned at a predetermined rate and a pulse is produced in a time slot corresponding to a switch which is ON. This system successfully eliminates a large number of connecting lines between the key switches and a circuit to which key switch signals are transferred. Such a system, however, requires a fixed period of time for scanning all of the key switches. As a result, an undesireable time lag tends to be produced between actuation of the switches and detection of such actuation. Furthermore, in such a system, the fixed scanning duration is wasteful of time in a case wherein a relatively small number of switches are ON. If scanning of each switch requires, for example, 12 .mu.s, the total time required for scanning all key switches is 12 .mu.S.times. 256= 3 ms. If a certain key switch is closed immediately after it has been scanned, there occurs delay of approximately 3 ms before the ON state of that key switch is detected by subsequent scanning. Furthermore, if only one switch is ON, the time of about 3 ms is wasted in one scanning cycle.
Another aspect to be considered in a construction of an electronic musical instrument is an arrangement for simultaneously reproducing a plurality of musical tones. Tone reproducing channels corresponding in a number to the maximum number of tones to be reproduced simultaneously must be provided, and a signal designating the tone selected key must be assigned to one of these channels.
Various proposals have been made in the past as to circuitry for assigning the signal to a suitable channel (e.g. U.S. Pat. No. 3,882,751 owned by the same applicant). In these proposals, an ON (or OFF) state of a key switch is detected by presence (or absence) of a pulse in a particular time slot, and each key switch individually possesses its own time slot. Accordingly, in order to store information of a depressed key in a certain allotted channel of a memory, it is necessary to measure the time from a certain reference time until occurrance of a time slot in which a pulse corresponding to the depressed key exists, and to cause the memory to store information representing this measured time. For example, time slots are sequentially counted by a timing counter from the reference time point and until occurrance of the depressed key pulse, and the resulting count, indicative of the measured time and hence indicative of the selected key, is stored in a memory. Accordingly, no key assignment is conducted for a time slot in which no pulse is present.
A keyboard of an electronic musical instrument generally has a large number of keys among which only a small number of keys are simultaneously depressed. In other words, the number of time slots in which no pulse is present is much larger than the number of time slots in which a pulse is present. Accordingly, time actually spent for the key assigning operation is only a small portion of the entire scanning time, the rest of the scanning time being wasted without any key assigning operation. Alternatively stated, only a small portion of time is allotted for actual key assigning operation due to this wasted portion of time with a result that difficulties arise in the circuit design since sufficiently ample operation time is not available.